package cn.wps.moffice.main.local.filebrowser.model;

import java.util.Date;

import cn.wps.moffice.main.framework.datastorage.DataModel;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

/**
 * 文件列表Item 的 文件属性.
 * 适用: 本地目录 所有文档 .
 * @author wangxiaohua
 *
 */
public class FileAttribute implements DataModel
{
	private static final long serialVersionUID = 1L;

	private int id;
	
    private String name;     //文件名（包含后缀名）
    
	private Date modifyTime;     //最后修改时间
	
    private boolean isFolder;    //是否文件夹
	
    private long fileSize;       //文件大小

	private Date createTime;     //创建时间
	
    private String mimeType;     //文件的mimeType
    
	private boolean isRootRecentFolder; //是否根目录的最近打开文件目录
	
	private boolean isAsh; // 是否置灰.
	
	@Expose
    @SerializedName("path")
    private String path;         //文件路径，用于本地存储和界面显示
	
    private boolean isThumbtack; //是否置顶（最近访问）
	
    private int iconResId;  //图标资源ID（根目录）
	
    private boolean isTag; //是否标签
    
    private boolean forceDirectoryHidden;//for amazon版本规定目录文件夹隐藏需求
    
    public FileAttribute()
    {
    }

    public int getId()
    {
        return id;
    }
    
    public void setId(int id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public Date getModifyTime()
    {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime)
    {
        this.modifyTime = modifyTime;
    }

    public boolean isFolder()
    {
        return isFolder;
    }

    public void setFolder(boolean isFolder)
    {
        this.isFolder = isFolder;
    }

    public long getFileSize()
    {
        return fileSize;
    }

    public void setFileSize(long fileSize)
    {
        this.fileSize = fileSize;
    }

    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public String getMimeType()
    {
        return mimeType;
    }

    public void setMimeType(String mimeType)
    {
        this.mimeType = mimeType;
    }

    
    public boolean isRootRecentFolder()
    {
        return isRootRecentFolder;
    }

    public void setRootRecentFolder(boolean isRootRecentFolder)
    {
        this.isRootRecentFolder = isRootRecentFolder;
    }

    public String getPath()
    {
        return path;
    }

    public void setPath(String path)
    {
        this.path = path;
    }

    public boolean isThumbtack()
    {
        return isThumbtack;
    }

    public void setThumbtack(boolean isThumbtack)
    {
        this.isThumbtack = isThumbtack;
    }

    public int getIconResId()
    {
        return iconResId;
    }

    public void setIconResId(int iconResId)
    {
        this.iconResId = iconResId;
    }
    
    public boolean isTag()
    {
        return isTag;
    }

    public void setTag(boolean isTag)
    {
        this.isTag = isTag;
    }
    
	public boolean isForceDirectoryHidden()
	{
		return forceDirectoryHidden;
	}

	public void setForceDirectoryHidden(boolean forceDirectoryHidden)
	{
		this.forceDirectoryHidden = forceDirectoryHidden;
	}

    @Override
    public int hashCode()
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((path == null) ? 0 : path.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        FileAttribute other = (FileAttribute) obj;
        if (path == null)
        {
            if (other.path != null) return false;
        }
        else if (!path.equals(other.path)) return false;
        return true;
    }
    
    public boolean isAsh() {
		return isAsh;
	}


	public void setAsh(boolean isAsh) {
		this.isAsh = isAsh;
	}

    @Override
    public String toString()
    {
        return "LocalFileData [path=" + path + "]";
    }
    
}
